fix(ollama): generate unique toolUseId instead of reusing tool name#2053
Open
Ratansairohith wants to merge 1 commit intostrands-agents:mainfrom
Open
fix(ollama): generate unique toolUseId instead of reusing tool name#2053Ratansairohith wants to merge 1 commit intostrands-agents:mainfrom
Ratansairohith wants to merge 1 commit intostrands-agents:mainfrom
Conversation
- toolUseId was set to the tool name, causing ID collisions when the same tool is called multiple times in one turn - format_request was using toolUseId instead of name for the function name sent back to Ollama Fixes strands-agents#2050
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2050
Changes
src/strands/models/ollama.py:toolUseIdinstead of reusing the tool name. Prevents ID collisions when the same tool is called multiple times in one turn.content["toolUse"]["name"]instead ofcontent["toolUse"]["toolUseId"]for the function name sent back to Ollama.tests/strands/models/test_ollama.py:toolUseIdis no longer equal to the tool nametest_tool_use_id_is_unique_and_not_tool_name— verifies uniqueness across multiple callstest_format_request_uses_tool_name_not_tool_use_id— verifies correct field is used for function nameTest plan